package com.ux.example
{
	import com.greensock.TweenMax;
	import com.greensock.easing.Cubic;
	import com.greensock.easing.Quad;
	import com.greensock.text.SplitTextField;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.text.TextField;
	
	public class SplitTextFieldExample extends Sprite
	{
		
		private var txt : TextField = new TextField();
		
		public function SplitTextFieldExample()
		{
			super();
			
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			txt.text = "ㅁㄴ아ㅣㅓ뢴;ㅏㄴㅇ머ㅗㄹ마너ㅗ리ㅏㄴ어모리ㅏ먼오리마ㅓㄴㄹ";
			txt.x = 300;
			addChild( txt );
			
			var stf:SplitTextField = new SplitTextField(txt);
			var len : int = stf.textFields.length;
			var centerNum : Number = Math.floor( stf.textFields.length/2 );
			for (var i:int = 0; i < len; i++) {
				TweenMax.to(
					stf.textFields[i], 
					1, 
					{
						blurFilter:{blurX:10, blurY:10},
						x:(i-centerNum)*20+300,
						y:100,
						delay:Math.random() * 0.5, 
						ease:Cubic.easeOut,
						repeat:1, 
						yoyo:true 
					}
				);
			}   
			   
		}
	}
}